import { Breadcrumb } from "antd"
import { useNavList } from "./left.menu"
import React, { useEffect, useMemo } from "react"

export const NavBread = () => {
  const navList = useNavList()

  const items = useMemo(() => {
    return navList
      .map(n => ({ title: n.name }))
      .concat({ title: "管理系统" })
      .reverse()
  }, [navList])
  useEffect(() => {
    document.title = items.map(n => n.title).join("-")
  }, [items])
  return <Breadcrumb items={items} />
}
